$dir = "/data1/bsi/refdata/genetics/HapMap/phased/transformed_ph3/CEU/TRIOS";
open(WRBUFF,">snps_hapmap3_cord_chr.txt");
for($i=0;$i<22;$i++)
{
	$j = $i+1;
	$file = "/data1/bsi/refdata/genetics/HapMap/phased/transformed_ph3/CEU/TRIOS/"."chr$j"."_phased.txt";
	open(BUFF,$file);
	$line = <BUFF>;
	while($line = <BUFF>)
	{
		chomp $line;
		@array = split(" ",$line);
		print WRBUFF $array[0]."\t".$array[1]."\t"."$j\n";
	}
}
open(BUFF,"markers_x.txt");
while($line = <BUFF>)
{
	chomp $line;
	@array = split(" ",$line);
	print WRBUFF $array[0]."\t".$array[1]."\t"."23\n";

}
